#ifndef TIMEDURL_H_
#define TIMEDURL_H_

#include "URL.h"
#include<iostream>
#include<string>

class TimedURL {
public:
	TimedURL() : protocol(""), path(""), domain("") { timestamp=0; }
	TimedURL(const std::string &urlProtocol, const std::string &urlDomain, const std::string &urlPath, std::time_t urlTimestamp)
	:protocol(urlProtocol), 
	 path(urlPath),
	 domain(urlDomain),
	 timestamp(urlTimestamp)
	 {}
	
	URL toURL() {
		URL url(domain, path, protocol);
		return url;
	}
	bool isValid() { return (timestamp!=0);}
	
	std::string getProtocol() const { return protocol; }
	std::string getDomain() const {return domain; }
	std::string getPath() const { return path; }
	std::time_t getTimestamp() const { return timestamp; }
	
	void setTimestamp(time_t time) { timestamp = time; }
	
private:
	std::string protocol;
	std::string path;
	std::string domain;
	std::time_t timestamp;
};



#endif /*TIMEDURL_H_*/
